<?php $this->deleteByCheckbox('.deleteQuestion',$this->baseUrl() . '/question/delete','.message',$this->subject->sid);?>
<div class="adminPanel">
	Otázky k predmetu <strong><?= $this->subject->name ?></strong> |
	<a href="<?= $this->url(array('controller' => 'subject','action' => 'index')) ?>">Späť na predmety</a> |
	<a href="<?= $this->url(array('controller' => 'question','action' => 'add')) ?>">Pridať</a> |
	<a href="#" class="deleteQuestion">Odstrániť</a>
</div>
<div class="message"></div>
<form>
<table>
	<tr>
		<th></th>
		<th>Číslo otázky</th>
		<th>Znenie otázky</th>
	</tr>
<?php
foreach($this->questions as $question):
?>
	<tr id="<?= $question->qid?>">
	<td><?= ++$question->qn ?></td>
		<td><input type="checkbox" name="<?= $question->qid?>" value="<?= $question->qid?>"></td>
		<td>
			<?php 
			/**
			 * TODO spravit neco s troma bodkami
			 */
			
			echo substr($question->text,0,450) . '...';
			?>
			<a href="
				<?=$this->url(array('controller' => 'question','action' => 'edit','qid' => $question->qid))?>"
			>Upraviť</a>						
		</td>
	</tr>

<?php endforeach;?>
</table>
</form>